const openBlindBox = require('./openBlindBox/index')
const updateUserInfo = require('./updateUserInfo/index')
const completeBindBox = require('./completeBlindBox/index')
const operationRecord = require('./operationRecord/index')
const addTask = require('./addTask/index')
const showUserTask = require('./showUserTask/index')
const deleteTask = require('./deleteTask/index')
const clockDay = require('./clockDay/index')
const completeClockDay = require('./completeClockDay/index')
const markClockDays = require('./markClockDays/index')
const addGift = require('./addGift/index')
const showUserGift = require('./showUserGift/index')
const deleteGift = require('./deleteGift/index')
const getUserInfo = require('./getUserInfo/index')
const registerUser = require('./registerUser/index')
const getUserOperation = require('./getUserOperation/index')

// 云函数入口函数
exports.main = async (event, context) => {
    switch (event.type) {
        case 'openBlindBox':
            return await openBlindBox.main(event, context)
        case 'updateUserInfo':
            return await updateUserInfo.main(event, context)
        case 'completeBlindBox':
            return await completeBindBox.main(event, context)
        case 'operationRecord':
            return await operationRecord.main(event, context)
        case 'addTask':
            return await addTask.main(event, context)
        case 'showUserTask':
            return await showUserTask.main(event, context)
        case 'deleteTask':
            return await deleteTask.main(event, context)
        case 'clockDay':
            return await clockDay.main(event, context)
        case 'completeClockDay':
            return await completeClockDay.main(event, context)
        case 'markClockDays':
            return await markClockDays.main(event, context)
        case 'addGift':
            return await addGift.main(event, context)
        case 'showUserGift':
            return await showUserGift.main(event, context)
        case 'deleteGift':
            return await deleteGift.main(event, context)
        case 'getUserInfo':
            return await getUserInfo.main(event, context)
        case 'registerUser':
            return await registerUser.main(event, context)
        case 'getUserOperation':
            return await getUserOperation.main(event, context)
    }
}